# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=torshammer
pkgver=1.0
pkgrel=7
groups=('blackarch' 'blackarch-dos')
pkgdesc='A slow POST Denial of Service testing tool written in Python.'
arch=('any')
url='http://sourceforge.net/projects/torshammer/'
license=('custom:unknown')
depends=('python2')
source=("$pkgname.zip::http://downloads.sourceforge.net/project/$pkgname/Torshammer/$pkgver/Torshammer%20${pkgver}.zip?")
sha512sums=('29c0858acbd9edaffe836b2c55b19f47cedaf3b8264e36e96d787eca1132f6d00c0dd14d49ca091924d518d0deee4c31bf1cee1fc25e1b814abcf4b7cd7e4b6d')

package() {
  cd "Torshammer 1.0"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py "\$@"
EOF
  chmod +x "$pkgdir/usr/bin/$pkgname"
}

